/*
 * @Description: $u.mixin.js
 * @Autor: Thlq
 * @Date: 2020-06-30 13:49:14
 * @LastEditors: Thlq
 * @LastEditTime: 2020-08-21 16:20:31
 */

import { mapState } from 'vuex'
import store from "@/store"

let $uStoreKey = []
try{
	$uStoreKey = store.state ? Object.keys(store.state) : []
}catch(e){
	
}

module.exports = {
	created() {
		this.$u.vuex = (name, value) => {
			this.$store.commit('$uStore', {
				name,value
			})
		}
	},
	computed: {
		...mapState($uStoreKey)
	}
}